package cn.robot.board.adapter;

import android.content.Context;

import cn.robot.board.R;
import cn.robotpen.model.entity.DeviceEntity;

/**
 * Created by rbt on 2020/4/7.
 */

public class DeviceAdapter extends AbsBaseAdapter<DeviceEntity> {
    public DeviceAdapter(Context context) {
        super(context, R.layout.pen_adapter_item);
    }

    /**
     * 清除集合内容
     */
    public void clearItems() {
        datas.clear();
    }

    @Override
    protected void bindDatas(ViewHolder holder, DeviceEntity data, int position) {
        holder.bindTextView(R.id.deviceName, data.getName())
                .bindTextView(R.id.deviceAddress, data.getAddress());
    }
}
